package com.example.threadmodel.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.concurrent.TimeUnit;


/**
 * 测试执行复杂任务，尤其是带有db、rpc操作的任务
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class StudentWithExpensiveOperation {
    private String id;
    private int coinCount;

    public void doExpensiveLogic(int coinCount) {
        this.coinCount = coinCount;

        try {
            TimeUnit.MILLISECONDS.sleep(10);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

    }
}